package com.cl.controller;

import com.cl.pojo.User;
import com.cl.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author
 * @create 2021-09-12 20:15
 */
@Controller
public class HelloController {

    @Autowired
    public UserService userService;

    @RequestMapping("/hello")
    public String hello(Model model){
        User user = userService.findUserById();
        System.out.println(user);
        model.addAttribute("user",user);
        return "hello";
    }
}
